package com.ostrich.cloud.ostrichUserService.client;

import com.ostrich.cloud.common.result.Result;
import com.ostrich.ostrichUserService.param.LoginCusParam;
import com.ostrich.ostrichUserService.param.rider.RegRider;
import com.ostrich.ostrichUserService.param.rider.UpdateRider;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "riderMangerClient" ,name = "ostrichUserService")
public interface RiderMangerClient {

    @PostMapping("riderRegister")
    @ApiOperation("骑手注册")
    public Result riderRegister(@RequestBody RegRider regRider);

    @PutMapping("updateRiderState")
    @ApiOperation("修改骑手状态")
    public Result updateRiderState(@RequestParam("riderId") Integer riderId,@RequestParam("status") String status);

    @PostMapping("riderLogin")
    @ApiOperation("骑手登录")
    public Result riderLogin(@RequestBody LoginCusParam loginCusParam);

    @GetMapping("getRiderByParentId")
    @ApiOperation("获取骑手个人中心")
    public Result getRiderById();

    @GetMapping("getAllRider")
    @ApiOperation("获取所有的骑手")
    public Result getAllRider(@RequestParam("current") Integer current
            ,@RequestParam("size") Integer size,@RequestParam(value = "status",required = false) String status
                              ,@RequestParam("businessmanId") Integer businessmanId);

    @GetMapping("getRider")
    @ApiOperation("更具id获取骑手信息")
    public Result getRider(@RequestParam("riderId") Integer riderId);


    @PutMapping("updateRider")
    public Result updateRider(@RequestBody UpdateRider updateRider);

    @GetMapping("addMoney")
    @ApiOperation("骑手加钱")
    public Result addMoney(@RequestParam("riderId") Integer riderId,
                           @RequestParam("money") Double money);

    @GetMapping("getCustomerLocByRider")
    @ApiOperation("骑手更具自己的地址获取")
    public Result getCustomerLocByRider(@RequestParam("latitude") String latitude,
                                        @RequestParam("logitude")  String logitud,
                                        @RequestParam("customerLocationId") Integer customerLocationId);
}
